Create and Manage Datasets

For Digitise Forms Datasources and Imported Datasources, Datasets define database tables and their columns (along with the tables associated with imported Web APIsClosed An API is a set of functions and procedures allowing the creation of applications that access the features or data of an operating system, application, or other service.) within the Datasource(s) that you want to work with in your form. The columns specified in the Dataset can be linked to Elements on your form to allow the Elements to display data from the Datasource and update the Datasource with information entered into the form. We call this linking, 'mapping'.

For Imported Stored Procedure Datasources, a Dataset can either define the set of parameters which must be passed to the Stored Procedure when you execute it or a set of data columns the Stored Procedure will return as a Result Set.

 

For Digitise Forms Datasources, a Dataset defines the information to be stored in a specific database table in the Datasource and allows you to map Elements to the columns in the Dataset. You can create multiple Datasets within the same Datasource, if you want to, with each Dataset representing a separate table within the database. The Project Datasource is a default Digitise Forms Datasource which can be used to store data for your form in a single location. When you add a new Dataset to a Digitise Forms Datasource, the database table, and the database if necessary, will be created when you next publish your form. If you want a Digitise Forms Datasource to use Stored Procedures to update the database, you can enable the use of Stored Procedures within the Dataset's properties (see below).

For Imported Datasources (including Web APIs), a Dataset specifies the columns in a table within the remote database or remote datasource that you want to map to Elements on the form. Data in the columns you specify can be downloaded from the remote database or datasource and displayed in your form, and information entered into the form can be used to update the remote database. A Dataset can only contain columns from one table, but, if the remote database or datasource includes multiple tables, you can create a separate Dataset for each of the tables you need. You can only create one Dataset per table.

For Imported Stored Procedure Datasources, there are two types of Dataset. A Parameters Dataset defines the parameters which must be passed to the Stored Procedure when it is executed. This type of Dataset is only created when the Stored Procedure does not return any Result Sets but does require one or more parameters to be passed in when it is run. You can only have one Parameters Dataset. A Result Set Dataset specifies the columns which will be included in a Result Set returned to the form by the Stored Procedure. If the Stored Procedure returns multiple Result Sets, you can create a Dataset for each Result Set you want to use in your form. You will need a separate Dataset for each Result Set and so you can have multiple Result Set Datasets in a single Datasource. If a Stored Procedure returns one or more Result Sets and requires parameters to be passed to it, the parameters do not have a separate Dataset but are passed to the Stored Procedure via a SQL query (see below). Data fields in a Result Set Dataset can be input mapped to Elements on your form to display the data returned from the Stored Procedure. Data fields in a Parameters Dataset can be output mapped to Elements on your form to provide the parameter values to be passed to the Stored Procedure when it is executed.

 

For Digitise Forms Datasources and Imported Datasources, a Dataset also allows you to specify one or more SQL queries, which can be used to specify which records in the database you want to be downloaded. For example, you might only want to display information from records between certain dates or which relate to the person using the form.

Imported Stored Procedure Datasets can only have one SQL query, which is generated automatically by Form Studio and cannot be changed. This query is used to execute the Stored Procedure. If the Stored Procedure returns at least one Result Set, any parameters required to be passed into the Stored Procedure will be included in this query.

 

To create, view and manage Datasets, click on the Datasources tab in the Project Explorer.

Select the relevant Datasource.

Any existing Datasets for the selected Datasource will be displayed in the Form Design workspace area of the Form Studio window:

Picture showing Datasets displayed in the Form Design Workspace area.

 

If Datasource or Dataset names are too long to be fully displayed, hovering your mouse pointer over a Datasource or a Dataset will display a tooltip showing the full name.

To open a Dataset, double-click on it or right-click and choose Open from the menu displayed.

The Dataset will open and display in the Form Design workspace:

Picture showing Mappings tab for an open Dataset.

The properties for the Dataset will be displayed in the Properties Pane.

 

When you have finished editing a Dataset, to close the Dataset details page, click on a Datasource name in the Datasources tab or click on the Pages tab and select a page. You can also open another item from the Projects tab which will close the Dataset details and open the new item in the Form Design workspace.

When you have finished making changes, save your Project to save the form.

 

 


See also:

Handling Datasets with Foreign Keys